﻿CREATE PROCEDURE [dbo].[sp_Update_GraceLoginTimes]
	@Id VARCHAR(10), 
	@Times int
AS
	IF @Times = 3
	BEGIN
		UPDATE [dbo].[Accounts]
		SET [GraceLoginTimes] = @Times, ForceChangePassword = 1, [Status] = 1 WHERE AccountID = @Id
	END
	ELSE
	BEGIN
		UPDATE [dbo].[Accounts]
		SET [GraceLoginTimes] = @Times, ForceChangePassword = 1 WHERE AccountID = @Id
	END
RETURN 0;